package com.ms.oschina.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AdapterView;

import com.ms.oschina.api.remote.OsChinaApi;
import com.ms.oschina.base.BaseViewHolder;
import com.ms.oschina.bean.Friend;
import com.ms.oschina.bean.FriendsList;
import com.ms.oschina.util.UiUtils;
import com.ms.oschina.viewholder.FriendViewHolder;

public class FriendAdapter extends PageIndexListAdapter<Friend> {

	
	public FriendAdapter(AbsListView listView, List<Friend> list,
			boolean loadMore) {
		super(listView, list, loadMore);
	}

	@Override
	public void onNormalItemClick(AdapterView<?> parent, View view,
			int position, long id) {
		Friend Friend = getListData().get(position);
		Context context = UiUtils.getContext();
		int mark = getMark();
		int detailId = Friend.getId();

	}

	@Override
	public BaseViewHolder<Friend> getItemViewHolder() {
		FriendViewHolder FriendViewHolder = new FriendViewHolder();
		return FriendViewHolder;
	}

	@Override
	public List<Friend> getLoadMoreData() throws Exception {
		int mark = getMark();
		switch (mark) {
		case FriendsList.TYPE_FOLLOWER:
			return OsChinaApi.getFriendInfo(pageIndex, FriendsList.TYPE_FOLLOWER);
		case FriendsList.TYPE_FANS:
			return OsChinaApi.getFriendInfo(pageIndex, FriendsList.TYPE_FANS);
		default:
			return null;
		}
	}

}
